Skip to main content
PVAC-HFHE’s security is based on the hardness of the Learning Parity with Noise (LPN) problem, a well-studied cryptographic assumption.

Learning Parity with Noise (LPN)

Problem definition

Given:
  • A random binary matrix A ∈ ^(t × n)
  • A secret binary vector s ∈ ^n
  • Noise rate τ ∈ (0, 1/2)
  • Samples y = As + e (mod 2) where each bit of e is 1 with probability τ
Problem: Recover the secret s from (A, y).
LPN is the binary variant of Learning With Errors (LWE). It’s considered quantum-resistant and has been studied extensively since the 1990s.

LPN in PVAC-HFHE

The scheme uses LPN with the following parameters (from include/pvac/core/types.hpp:58-61):
Noise rate: τ = 1/8 = 0.125

Security analysis

From the source code comments (include/pvac/core/types.hpp:53-56):
Security levels:
  • Information-theoretic bound: 2226 bits
  • Classical security: 200+ bits (exceeds 128-bit target)
  • Quantum security: 100+ bits (exceeds NIST PQC requirements)
The scheme provides 128-bit security against both classical and quantum adversaries when using the default parameters.

PRF construction

LPN-based PRF

The scheme derives pseudorandom field elements using LPN:
From include/pvac/crypto/lpn.hpp:263-268:
Triple-product construction: Uses three independent LPN samples multiplied together for enhanced security.

PRF core algorithm

From include/pvac/crypto/lpn.hpp:235-261:
Steps:
  1. Generate lpn_t = 16384 LPN samples using AES-CTR mode
  2. Derive Toeplitz matrix randomness (domain-separated)
  3. Apply Toeplitz hashing to extract 127 bits
  4. Map to a nonzero field element

LPN sample generation

From include/pvac/crypto/lpn.hpp:194-233:
Security note: Uses AES-CTR with hardware AES-NI for cryptographically secure randomness.

Domain separation

The scheme uses domain separation to ensure different PRF calls are independent: From include/pvac/core/types.hpp:14-31:
Domain separation prevents attacks where an adversary tries to correlate outputs from different PRF calls.

Hypergraph matrix H

The public key includes a random binary matrix H of size m_bits × n_bits: Parameters (from include/pvac/core/types.hpp:42-45):
Matrix structure:
  • Dimensions: 8192 × 16384 bits (16 MB dense, or ~200 KB sparse representation)
  • Column weight: Each column has exactly 192 ones
  • Random generation: Using cryptographically secure PRG

Syndrome computation

Each edge has a syndrome vector:
where:
  • s ∈ ^8192 is the syndrome (stored in ciphertext)
  • x ∈ ^16384 has Hamming weight 128 (kept secret)
  • H is the public matrix
Security: Without the secret key, finding x from s requires solving a syndrome decoding problem, which is NP-hard.
The hypergraph matrix H is stored in the public key (~8 MB). This is a trade-off for fast encryption/decryption.

Key generation security

From include/pvac/crypto/keygen.hpp:35-136:

Secret key generation

Secret key size: 256 + 4096 = 4352 bits (544 bytes)

Multiplicative group generator

The scheme finds a generator g of the subgroup of order B = 337:
Security check: Verifies that B | (p-1), ensuring the subgroup exists.

Root of unity

Finds a primitive B-th root of unity ω_B:
The root of unity enables efficient polynomial operations and is used in advanced features like recryption.

Constant-time operations

To prevent timing side-channels, key operations are constant-time:

Constant-time field inversion

From include/pvac/core/field.hpp:229-269, the fp_inv_ct function uses windowed exponentiation with:
  • Fixed-time table lookups
  • No data-dependent branches
  • Constant number of field multiplications

Constant-time equality test

From include/pvac/core/ct_safe.hpp (implied). No branches: Uses bitwise operations only.

Security assumptions

Primary assumption

LPN Hardness: Given (A, y = As + e) with noise rate τ = 1/8, it is computationally infeasible to recover s in time less than 2^128.

Supporting assumptions

  1. AES-256 in CTR mode is a secure PRG
  2. SHA-256 is collision-resistant (for key derivation)
  3. Random oracle model for Toeplitz hashing

Known attacks

Best known attacks on LPN(n=4096, t=16384, τ=1/8):
All known attacks exceed the 128-bit security target by a significant margin.

Threat model

Honest-but-curious server

The server:
  • Can: Perform homomorphic operations on ciphertexts
  • Cannot: Decrypt ciphertexts without the secret key
  • Cannot: Learn anything about plaintexts beyond what’s leaked by operation patterns

What is NOT protected

PVAC-HFHE does not provide:
  • Circuit privacy: The server can see the computation graph structure
  • Access pattern hiding: The server knows which operations are performed
  • Ciphertext indistinguishability: Different plaintexts may yield different ciphertext sizes

Side-channel resistance

The implementation includes:
  • Constant-time field inversion
  • Constant-time comparisons
  • No secret-dependent memory accesses in critical paths
However:
  • Timing variations may leak information about ciphertext sizes
  • Cache timing attacks are not fully mitigated
  • Power analysis countermeasures are not implemented
For production use, additional hardening against side-channels would be required.

Security best practices

Key management

Seed generation

Parameter selection

Comparison with other assumptions

LPN is closely related to LWE but over binary fields. It’s considered quantum-resistant and has been studied extensively in coding theory and cryptography.

Next steps

Getting started

Build your first encrypted application

API reference

Explore the complete API